* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: #0a0e27;
    color: #fff;
    padding: 15px;
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 96%;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 15px;
    padding: 12px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 8px;
    flex-shrink: 0;
}

.header h1 {
    font-size: 26px;
    margin-bottom: 5px;
}

.status {
    font-size: 13px;
    color: #4ade80;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    /* 图表区域至少占屏幕高度的50% */
    min-height: 50vh;
    flex: 1;
}

.chart-wrapper {
    background: #1a1f3a;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.chart-title {
    text-align: center;
    font-size: 13px;
    margin-bottom: 8px;
    color: #94a3b8;
    font-weight: bold;
    flex-shrink: 0;
}

.chart {
    width: 100%;
    flex: 1;
    min-height: 0;
}

.metrics-panel {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    background: #1a1f3a;
    padding: 15px;
    border-radius: 8px;
    flex-shrink: 0;
}

.metric-card {
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    transition: transform 0.2s;
}

.metric-card:hover {
    transform: translateY(-3px);
}

.metric-label {
    font-size: 12px;
    color: #e2e8f0;
    margin-bottom: 6px;
}

.metric-value {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

.metric-unit {
    font-size: 11px;
    color: #cbd5e1;
    margin-left: 3px;
}

.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.connected {
    background: #10b981;
    color: white;
}

.disconnected {
    background: #ef4444;
    color: white;
}

/* 响应式优化 */
@media (max-width: 1600px) {
    .metric-value {
        font-size: 16px;
    }
}

@media (max-width: 1200px) {
    .charts-container {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: auto auto;
    }
    
    .metrics-panel {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: auto auto;
    }
}

@media (max-width: 768px) {
    .charts-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metrics-panel {
        grid-template-columns: repeat(2, 1fr);
    }
}